package cn.edu.nju.oraldefense.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import cn.edu.nju.oraldefense.dao.DeanDao;
import cn.edu.nju.oraldefense.model.Dean;
import cn.edu.nju.oraldefense.service.DeanService;

@Component
public class DeanServiceImpl implements DeanService {
	private DeanDao deanDao;

	public DeanDao getDeanDao() {
		return deanDao;
	}

	@Resource
	public void setDeanDao(DeanDao deanDao) {
		this.deanDao = deanDao;
	}

	public Dean getByUsername(String username) {
		List list = deanDao.findByUsername(username);
		Dean dean = null;
		if (list.size() > 0) {
			dean = (Dean) list.get(0);
		}
		return dean;
	}

}
